<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>精品课程</title>
    <link rel="stylesheet" href="path/to/your/bootstrap.css">
    <script>
        function logout() {
            fetch('${APP_PATH}/logout', {
                method: 'POST',
                headers: {
                    'Content-Type': 'application/json'
                },
                credentials: 'same-origin' // 如果需要跨域携带cookie
            }).then(response => {
                if (response.redirected) {
                    window.location.href = response.url;
                } else {
                    console.error('Logout failed:', response);
                }
            }).catch(error => {
                console.error('Logout error:', error);
            });
        }
    </script>
</head>
<body>
<nav class="navbar navbar-inverse navbar-fixed-top">
    <div class="container-fluid">
        <div class="navbar-header">
            <a class="navbar-brand" href="#">精品课程</a>
        </div>
        <div>
            <ul class="nav navbar-nav">
                <li><a href="${APP_PATH}">首页</a></li>
                <li><a href="${APP_PATH}/avideo">视频教程</a></li>
                <li><a href="${APP_PATH}/asource">资料下载</a></li>
                <li><a href="${APP_PATH}/aanswer2">留言板</a></li>
                <li><a href="${APP_PATH}/frontPage/home.jsp">个人中心</a></li>
                <li><a href="${APP_PATH}/about.jsp">关于</a></li>
            </ul>
            <c:if test="${username != null}">
                <ul class="nav navbar-nav navbar-right">
                    <li><a href="update.jsp">欢迎你${username}</a></li>
                    <li><a href="javascript:void(0);" onclick="logout()">退出登陆</a></li>
                </ul>
            </c:if>
        </div>
    </div><!-- /.container-fluid -->
</nav>
</body>
</html>